package cn.wolfcode.luowowo.article.query;

import cn.wolfcode.luowowo.common.query.QueryObject;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class TravelQuery extends QueryObject{
    private Long destId = -1L;

    //按出行天数
    private int dayType = -1;

    //按人均花费
    private int perExpendType = -1;

    //按出发时间
    private int travelTimeType = -1;

    private int orderType = 1;


    /**
     * 如果是1,那就规定从map里找出两个值
     * @return
     */
    public Travelcondtion getDay(){
        return Travelcondtion.dayMap.get(dayType);
    }

    public Travelcondtion getPerExpend(){
        return Travelcondtion.preExpendMap.get(perExpendType);
    }

    public Travelcondtion getTravelTime(){
        return Travelcondtion.travelTimeMap.get(travelTimeType);
    }

    public String getOrderBy(){
        return orderType==1?"t.createTime desc":"t.viewnum desc";
    }

}
